<!-- 外卖门店详情 -->
<template name="shopdetailCom2">
	<view class="shopdetailCom shopdetailCom2">
		<view class="module_base module_info">
			<view class="module_title">绑定信息</view>
			<view class="module_content info_content">
				<view class="info_eve">
					<view class="info_eve_title">基础支付</view>
					<view>{{basedata.basepay_bind_status?'已':'未'}}绑定</view>
				</view>
				<view class="info_eve">
					<view class="info_eve_title">外卖门店</view>
					<view>{{basedata.waimai_bind_status?'已':'未'}}绑定</view>
				</view>
			</view>
			<view class="module_title">门店信息</view>
			<view class="module_content info_content">
				<view class="info_eve">
					<view class="info_eve_title">门店联系人</view>
					<view>{{basedata.realname}}</view>
				</view>
				<view class="info_eve">
					<view class="info_eve_title">门店联系电话</view>
					<view class="info_eve_phone" @click="makePhone(basedata.phone)">{{basedata.phone}}</view>
				</view>
				<view class="info_eve info_address">
					<view class="info_eve_title">门店地址</view>
					<view>
						<image @click="navAddress()" src="../../../static/img/ic_location_2.png"></image>
					</view>
				</view>
				<view class="info_eve">
					<view>{{basedata.address}}</view>
				</view>
			</view>
		</view>
		<!-- <view style="height: 150rpx;"></view>
		<view class="module_base module_infoBtn" style="
				padding: 30rpx;
				background-color: #FFFFFF;
			">
			<view class="infoBtn">
				<button type="primary" @click="infoBtnfun()">跟进商户</button>
			</view>
		</view> -->
	</view>
</template>

<script>
	import { seasshopinfo,shopdetailbase } from '../../../api/index.js'
	export default {
		name: "shopdetailCom2",
		data() {
			return {
				basedata:{},
				basedata2:{}
			}
		},
		mounted: function() {
			this.getSeasshopinfo()
			this.getShopdetailbase()
		},
		props:{
			suid:''
		},
		methods: {
			//获取商户基本信息
			getSeasshopinfo:function(){
				let that = this;
				seasshopinfo({id:this.suid}).then((res) => {
					console.log(res)
					if(res.code == 0){
						that.basedata = res.data.shopinfo;
						
						that.$emit('editdataFun',that.basedata);
					}else{
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				}).catch((e) => {
					console.log(e)
				})
			},
			//获取商户详情
			getShopdetailbase:function(){
				let that = this;
				shopdetailbase({id:this.suid}).then((res) => {
					console.log(res)
					if(res.code == 0){
						that.basedata2 = res.data;
					}else{
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				}).catch((e) => {
					console.log(e)
				})
			},
			infoBtnfun:function(){
				uni.showToast({
					icon:'none',
					title:'功能正在开发中'
				})
				return ;
			},
			//跳转到高德地图
			navAddress:function(){
				let that = this;
				if(!that.basedata2.longitude || !that.basedata2.latitude){
					uni.showToast({
						title: "经纬度不能为空",
						icon: 'none'
					})
					return ;
				}
				if(!that.basedata.address){
					uni.showToast({
						title: "地址不能为空",
						icon: 'none'
					})
					return ;
				}
				cm.jumpMap({
					longitude:that.basedata2.longitude,
					latitude:that.basedata2.latitude,
					destination:that.basedata.address
				})
			},
			//拨打电话
			makePhone:function(phone){
				cm.makePhoneCall({
					phone:phone
				});
			}
		},
		components: {
			
		}
	}
</script>

<style lang="scss" scoped>
	@import './shopdetailCom.scss';
</style>
